;;; ansible.cfg.el --- Summary
;;; Commentary:
;;; Ansible configuration
;;; Code:

(require 'package.cfg)

(package-install-if-absent 'company-ansible)
(package-install-if-absent 'ansible-doc)
(package-install-if-absent 'yaml-mode)

(use-package company-ansible
  :config
  (add-to-list 'company-backends 'company-ansible))

(use-package ansible-doc
  :diminish ansible-doc-mode)

(use-package yaml-mode
  :init
  (add-hook 'yaml-mode-hook #'ansible-doc-mode)
  (add-hook 'yaml-mode-hook 'yas-minor-mode)
  (add-hook 'yaml-mode-hook 'flycheck-mode)
  :config
  (define-key ansible-doc-mode-map (kbd "C-c ?") nil)
  (define-key ansible-doc-mode-map (kbd "M-?") #'ansible-doc))

(provide 'ansible.cfg)
;;; ansible.cfg.el ends here
